package com.matrix.basecore.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding
import com.matrix.utils.common.ActivityManager

abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {

    public lateinit var mViewBinding: T

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mViewBinding = getViewBinding()
        setContentView(mViewBinding.root)
        ActivityManager.addActivity(this)
        initView()
        initData()
        initListener()
    }

    abstract fun getViewBinding(): T

    abstract fun initView()

    open fun initData() {

    }

    open fun initListener() {

    }

}